package ex.hql.utils;

import ex.hql.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @program:yeb
 * @author: hql
 * @Time: 2021/8/28  16:26
 * @description: 操作员工具类
 */

public class AdminUtils {

    /**
     * 返回当前登录用户
     * @return
     */
    public static Admin getCurrentAdmin(){
        return ((Admin) SecurityContextHolder.getContext().getAuthentication()
                .getPrincipal());
    }

}
